package top.kikt;

import javassist.*;

import java.io.IOException;

public class Crack {

    public static void main(String[] args) throws NotFoundException, CannotCompileException, IOException {
        ClassPool pool = ClassPool.getDefault();

        CtClass ctClass = pool.get("top.kikt.User");
        CtMethod[] says = ctClass.getDeclaredMethods("say");
        CtMethod say = says[0];
        say.setBody("{System.out.println(\"The user crack say!\");}");

        ctClass.writeFile("build/crack/java/main");

        User user = new User();
        user.say();
    }

}
